using System.Collections;
using System.Collections.Generic;
using UnityEngine;

public class touzi : MonoBehaviour
{
    
    public Animator animator;
    float f = -1;
    int zhuangtai = 1;//p1
    public int random;


    public followland followland;
    public followland1 followland1;

    public void Start()
    {

        


    }


    public void Update()
    {
        if(Input.GetKeyUp(KeyCode.J))
        {
            f = -f;
            random = Random.Range(1, 7);
            if (zhuangtai == 1)
            {
                
                if (f < 0)
                {
                    
                    //Debug.Log(random);
                    followland.gonext(random);
                    zhuangtai = -zhuangtai;

                }


                
            }
            else
            {
                if (f < 0)
                {

                    followland1.gonext(random);
                       zhuangtai = -zhuangtai;
                }
                
            }            
        }
        
        animator.SetFloat("f", f);
    }






    







}
